package com.lxd.property.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lxd.property.dao.DepartmentMapper;
import com.lxd.property.pojo.Department;
import com.lxd.property.service.DepartmentService;

@Service("departmentService")
@Transactional
public class DepartmentServiceImpl implements DepartmentService {

	
	@Autowired
	private DepartmentMapper departmentMapper;
	
	@Override
	public Map<String, Object> findAllDepartment(Map<String, Object> map) {
		// TODO Auto-generated method stub
		
		Map<String, Object> resMap = new HashMap<String, Object>();
		
		List<Department> list= departmentMapper.findAllDepartment(map);
		
		Long total=departmentMapper.findAllDepartmentCount(map);
		
		resMap.put("rows", list);
		
		resMap.put("total", total);
		
		return resMap;
		
	}

	@Override
	public Integer disableDepartment(Map<String, Object> map) {
		// TODO Auto-generated method stub
		return departmentMapper.disableDepartment(map);
	}

	@Override
	public Department judgeRepeation(Department department) {
		// TODO Auto-generated method stub
		return departmentMapper.judgeRepeation(department);
	}

	@Override
	public Integer addDepartment(Department department) {
		// TODO Auto-generated method stub
		return departmentMapper.addDepartment(department);
	}

	@Override
	public Department findDepartmentById(Integer id) {
		// TODO Auto-generated method stub
		return departmentMapper.findDepartmentById(id);
	}

	@Override
	public Integer updateDepartment(Department department) {
		// TODO Auto-generated method stub
		return departmentMapper.updateDepartment(department);
	}

	@Override
	public List<Department> findAllDepartmentToList() {
		// TODO Auto-generated method stub
		return departmentMapper.findAllDepartmentToList();
	}

	@Override
	public List<Department> findAllDepartmentList() {
		// TODO Auto-generated method stub
		return departmentMapper.findAllDepartmentList();
	}

}
